import {ProjectModel} from "../../biz/model/ProjectModel";
import {Http} from "../Http";
import {ConfigModel} from "../../biz/model/ConfigModel";
import {QueryResult} from "material-table";

export class ProjectApi {
    static list(): Promise<Array<ProjectModel>> {
        return Http.getModel<Array<ProjectModel>>("/manager/rest/projects/list");
    }

    static create(project: ProjectModel): Promise<ProjectModel> {
        return Http.postModel<ProjectModel>("/manager/rest/projects/create", project);
    }

    static find(projectId: string): Promise<ProjectModel> {
        return Http.getModel<ProjectModel>("/manager/rest/projects/" + projectId + "/info");
    }

    static findConfig(projectId:string) :Promise<ConfigModel>{
        return Http.getModel<ConfigModel>("/manager/rest/projects/"+projectId+"/configs")
    }


}
